package sctu.edu.java.year2016.team06.luoxin.day20160604.chapter11_1;

/**,再编写一个Student类，该类有一个产生异常的speak(int m)方法，要求参数m的值大于1000时，方法抛出
 * 一个MyException对象
 * Created by Administrator on 2016/6/3.
 */
public class Student {

    public static void speak (int m) throws MyException{
        if(m>1000){
            throw new MyException();
        }
        System.out.println(m);
    }
    public void amount(int m){
        try {
            speak(m);
        } catch (MyException e) {
            e.printStackTrace();
        }
    }
}
